<!--#include file="easyasp/easp.asp" -->
<%
dim conn,ConnStr,Datafile
Set Conn=Server.CreateObject("ADODB.Connection")
	Datafile = "popasp.mdb"
	Connstr="Provider=Microsoft.Jet.OLEDB.4.0;Data Source="&Server.MapPath(Datafile)
	Response.Write ConnStr
	Conn.open ConnStr

	
	Dim fileName,f
	fileName = request("fileName")
	f= Server.MapPath(fileName)
	' echo f
	transFile(f)
	
%>
<%
Sub echo(str)
	Response.Write(str)
End Sub
Sub transFile(f)	
	On Error Resume Next
	dim fs,ReadStream,ret
	dim sql
	Set fs = Server.CreateObject("Scripting.FileSystemObject")
	Set ReadStream = fs.OpenTextFile(f,1)
	sql = ReadStream.ReadAll
	ReadStream.close
	dim aSql,iLoop
	aSql = split(sql,";")
	for iLoop = 0 to UBound(aSql)
		if len(aSql(iLoop)) > 5 then
			' Easp.Db.Query(aSql(iLoop))
			conn.execute (aSql(iLoop))
			
		echo "<div style='padding:3px 0px;border-bottom:1px solid #069;'><b>" & iLoop + 1 & "、</b>" & aSql(iLoop) & "</div>"
		end if
	next
	echo "<font color=red><h4>命令执行成功</h4></font>"
End Sub	

	
%>
